//页面初始化
var icon = "<i class='fa fa-times-circle'></i> ";
$(document).ready(function () {
	initPage();
	
	$("#updateUserForm").validate({
		rules : {
			"userAcct" : {
				required : true
			},
			"userPwd" : {
				required : true
			},
			"userName" : {
				required : true
			}
		},		
		messages : {
			"userAcct" : {
				required : icon + "请输入用户账号"
			},
			"userPwd" : {
				required : icon + "请输入用户密码"
			},
			"userName" : {
				required : icon + "请输入用户姓名"
			}
		},
		submitHandler : function (form) {
			var dataJson = JSON.stringify($("#updateUserForm").serializeObject());
			console.log(dataJson);
			LocalAjax({
				url : $(form).attr('action'),
				data : dataJson,
				async : false,
				success : function(data) {
					var result = eval(data);
					if (result.resultCode == '1') {
						parent.layer.msg('保存成功', {icon: 1,time: 1000});
						parent.$("#searchForm").submit();
               		 	closeWin();
					} else {
						var message = result.message;
						if (message != "") {
							layer.alert(message);
						} else {
							layer.alert("保存失败");
						}
					}
				}
			});
		}
	});
});

function initPage(){
	//初始化
	if($("#sexVal").val()=="1"){
		$("#sex").val("1");
	} 
}
//保存
function save(){
	
}
